#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
using namespace std;
int main(){
	int n;
	int min = 1024,max = -1;
	int temp;
	cin >> n; 
	for(int i = 0;i < n;i++){
		cin >> temp;
		if(temp<min) min = temp;
	}
	for(int i = 0;i < n;i++){
		cin >> temp;
		if(temp>max) max = temp;
	}
	if(min-max>=1) cout << "Yes " << min-max;
	else cout << "No " << max-min+1;
	return 0;
}
